<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="../../../../../styles.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="11%"><strong>Package</strong></td>
    <td width="89%">com.jxl.shuriken.controls </td>
  </tr>
  <tr>
    <td><strong>Class</strong></td>
    <td>public class Button</td>
  </tr>
  <tr>
    <td><strong>Inheritance</strong></td>
    <td>Button &gt; SimpleButton &gt; UIComponent &gt; MovieClip </td>
  </tr>
  <tr>
    <td><strong>Subclasses</strong></td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>This class decorates the intrinsic TextField class' prototype with some help methods and properties. This is to save RAM while still making the TextField easier to work with from a coding perspective. For example, to change a TextField's position on stage, you have to do the following:</p>
<p>
<pre><code>my_txt._x = 100;
my_txt._y = 200;</code></pre>
</p>
<p>With the decoration, you can now go:</p>
<p>
<pre><code>my_txt.move ( 100, 200 );</code></pre>
</p>
<p>This reduces the amount of code you have to write by 1 line. If you consider the hundreds of lines of code it takes to move a multitude of TextFields around, you've now effectively divided that by 2. So, if you had 500 lines of code to change the position of TextFields _x and _y properties, you now have  250. </p>
<p>The same goes for the set size method:</p>
<p>
<pre><code>my_txt._width = 300;
my_txt._height = 18;

// vs.

my_txt.setSize ( 300, 18 );</code></pre>
</p> TODO: Considering moving this function to UIComponent.
<p>view examples</p>
<p>See also</p>
<h4>Public Methods</h4>
<p>decorateTextField ( ) : Void </p>
</body>
</html>
